'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 副本
 * @author sundbcn@gmail.com (sun debing)
 */

var _ = require('lodash');
var eventConditionCheck = require('../libs/eventConditionCheck');
var dataApi = require('../libs/dataApi');

/**
 * 获取星级
 * @param  {[type]} copy_id [description]
 * @return {[type]}         [description]
 */
exports.getStar = function (event_id, role_model, soldier_model) {
    var event_type_conf = dataApi.event_type.findById(event_id);
    var star = 0;
    if (eventConditionCheck.check(event_type_conf.condition_1, role_model, soldier_model)) {
        star++;
    }

    if (eventConditionCheck.check(event_type_conf.condition_2, role_model, soldier_model)) {
        star++;
    }

    if (eventConditionCheck.check(event_type_conf.condition_3, role_model, soldier_model)) {
        star++;
    }
    return star;
};
